<template>
  <div :class="{'ly-is-full':isFull}">
      <div class="tableSelect" ref="tableSelect">
          
      </div>
      <div class="table">
          <div  class="space-inner">
              <div class="lycard">
                  <div class="space-header">
                      <div class="lycard-left space-header-title">报价审核</div>
                      <div class="lycard-right">
                          <div @click="setFull">
                              <el-tooltip content="全屏" placement="bottom">
                                  <el-icon ><full-screen /></el-icon>
                              </el-tooltip>
                          </div>
                      </div>
                  </div>
                  <div class="space-main">
                      <Editor style="height: 550px;" :data="data" :svg="svg" :view='{"width":width,"height":height,"offsetx":offsetx, "offsety":offsety}'></Editor>
                  </div>
              </div>
          </div>
      </div>
  </div>
</template>
<script>
  import { lyMixins } from "@/mixins/mixins"
  import Editor from "../../components/editor/index.vue";  
  import {mallPojectDetail} from '@/api/api'
  import {ajaxGet} from '@/api/request'
  export default {
      mixins: [lyMixins],
      name:'priceManager',
      components:{
          Editor
      },
      data() {
          return {
              isFull:false,
              svg:"",
              width:0,
              height:0,
              docwidth:0,
              docheight:0,
              offsetx:0,
              offsety:0,
              data:[]
          }
      },
      methods:{
          setFull(){
              this.isFull=!this.isFull
              window.dispatchEvent(new Event('resize'))
          },
          //获取列表
          async getData(id,file){
              this.loadingPage = true
              let that=this

              mallPojectDetail(id).then(res => {
                   this.loadingPage = false
                   if(res.code ==2000) {
                      this.data = res.data.data.data==null?[]:res.data.data.dat
                   }
               })
               ajaxGet({url: `static/`+file+`.svg`,params:{}},"GET").then(res=>{
                
                that.data = res.data==null?[]:res.data
                console.log(that.data)
                that.svg = res.svg
                that.offsetx = res["box"][0][0]
                that.offsety = res["box"][0][1]
                that.width = res["box"][1][0]
                that.height = res["box"][1][1]
              })
          },
      },
      created() {
          //console.log(this.$route.query.id)
          this.getData(this.$route.query.id,this.$route.query.name)
      },
  }
</script>
<style scoped>
  .space-inner{
      height: 500px;
  }
  .lycard{
      background: var(--el-bg-color);
      box-shadow: var(--el-box-shadow-light);
      border: 1px solid var(--el-border-color-light);
  }
  .space-header{
      border-bottom: 1px solid var(--el-color-info-light-7);
      font-size: 14px;
      padding: 4px;
      display: flex;
      justify-content: space-between;
      align-items: center;
  }
  .space-header-title{
      padding: 8px 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      margin-left: 10px;
  }
  .space-main{
      padding: 20px;
      height: 600px
  }
  .space-main-up{
      display: flex;
      align-items: center;
      column-gap: 20px;
      /*justify-content: space-around;*/
  }
  .space-main-up-cpu{
      font-size: 12px;
      display: flex;
      flex-direction: column;
      line-height: 20px;
      /*width: 200px;*/
      color: #666666;
  }
  ::v-deep(.el-col) {
      margin-bottom: 11px;
  }
</style>
